home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIUnicharStreamLoader.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  10KB  |  242 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIUnicharStreamLoader.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIUnicharStreamLoader_h__
  6. #define __gen_nsIUnicharStreamLoader_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIUnicharInputStream; /* forward declaration */
  18.  
  19. class nsIUnicharStreamLoader; /* forward declaration */
  20.  
  21. class nsIChannel; /* forward declaration */
  22.  
  23.  
  24. /* starting interface:    nsIUnicharStreamLoaderObserver */
  25. #define NS_IUNICHARSTREAMLOADEROBSERVER_IID_STR "e06e8b08-8cdd-4503-a0a0-6f3b943602af"
  26.  
  27. #define NS_IUNICHARSTREAMLOADEROBSERVER_IID \
  28.   {0xe06e8b08, 0x8cdd, 0x4503, \
  29.     { 0xa0, 0xa0, 0x6f, 0x3b, 0x94, 0x36, 0x02, 0xaf }}
  30.  
  31. class NS_NO_VTABLE nsIUnicharStreamLoaderObserver : public nsISupports {
  32.  public: 
  33.  
  34.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUNICHARSTREAMLOADEROBSERVER_IID)
  35.  
  36.   /**
  37.    * Called when the first full segment of data if available.
  38.    *
  39.    * @param aLoader the unichar stream loader
  40.    * @param aContext the aContext parameter passed to the loader's init method
  41.    * @param aFirstSegment the raw bytes of the first full data segment
  42.    * @param aLength the length of aFirstSegment
  43.    *
  44.    * @return charset corresponding to this stream
  45.    */
  46.   /* ACString onDetermineCharset (in nsIUnicharStreamLoader aLoader, in nsISupports aContext, [size_is (aLength)] in string aFirstSegment, in unsigned long aLength); */
  47.   NS_IMETHOD OnDetermineCharset(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, const char *aFirstSegment, PRUint32 aLength, nsACString & _retval) = 0;
  48.  
  49.   /**
  50.    * Called when the entire stream has been loaded.
  51.    *
  52.    * @param aLoader the unichar stream loader
  53.    * @param aContext the aContext parameter passed to the loader's init method
  54.    * @param aStatus the status of the underlying channel
  55.    * @param aUnicharData the unichar input stream containing the data.  This
  56.    *        can be null in some failure conditions.
  57.    */
  58.   /* void onStreamComplete (in nsIUnicharStreamLoader aLoader, in nsISupports aContext, in nsresult aStatus, in nsIUnicharInputStream aUnicharData); */
  59.   NS_IMETHOD OnStreamComplete(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, nsresult aStatus, nsIUnicharInputStream *aUnicharData) = 0;
  60.  
  61. };
  62.  
  63. /* Use this macro when declaring classes that implement this interface. */
  64. #define NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER \
  65.   NS_IMETHOD OnDetermineCharset(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, const char *aFirstSegment, PRUint32 aLength, nsACString & _retval); \
  66.   NS_IMETHOD OnStreamComplete(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, nsresult aStatus, nsIUnicharInputStream *aUnicharData); 
  67.  
  68. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  69. #define NS_FORWARD_NSIUNICHARSTREAMLOADEROBSERVER(_to) \
  70.   NS_IMETHOD OnDetermineCharset(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, const char *aFirstSegment, PRUint32 aLength, nsACString & _retval) { return _to OnDetermineCharset(aLoader, aContext, aFirstSegment, aLength, _retval); } \
  71.   NS_IMETHOD OnStreamComplete(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, nsresult aStatus, nsIUnicharInputStream *aUnicharData) { return _to OnStreamComplete(aLoader, aContext, aStatus, aUnicharData); } 
  72.  
  73. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  74. #define NS_FORWARD_SAFE_NSIUNICHARSTREAMLOADEROBSERVER(_to) \
  75.   NS_IMETHOD OnDetermineCharset(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, const char *aFirstSegment, PRUint32 aLength, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnDetermineCharset(aLoader, aContext, aFirstSegment, aLength, _retval); } \
  76.   NS_IMETHOD OnStreamComplete(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, nsresult aStatus, nsIUnicharInputStream *aUnicharData) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStreamComplete(aLoader, aContext, aStatus, aUnicharData); } 
  77.  
  78. #if 0
  79. /* Use the code below as a template for the implementation class for this interface. */
  80.  
  81. /* Header file */
  82. class nsUnicharStreamLoaderObserver : public nsIUnicharStreamLoaderObserver
  83. {
  84. public:
  85.   NS_DECL_ISUPPORTS
  86.   NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER
  87.  
  88.   nsUnicharStreamLoaderObserver();
  89.  
  90. private:
  91.   ~nsUnicharStreamLoaderObserver();
  92.  
  93. protected:
  94.   /* additional members */
  95. };
  96.  
  97. /* Implementation file */
  98. NS_IMPL_ISUPPORTS1(nsUnicharStreamLoaderObserver, nsIUnicharStreamLoaderObserver)
  99.  
  100. nsUnicharStreamLoaderObserver::nsUnicharStreamLoaderObserver()
  101. {
  102.   /* member initializers and constructor code */
  103. }
  104.  
  105. nsUnicharStreamLoaderObserver::~nsUnicharStreamLoaderObserver()
  106. {
  107.   /* destructor code */
  108. }
  109.  
  110. /* ACString onDetermineCharset (in nsIUnicharStreamLoader aLoader, in nsISupports aContext, [size_is (aLength)] in string aFirstSegment, in unsigned long aLength); */
  111. NS_IMETHODIMP nsUnicharStreamLoaderObserver::OnDetermineCharset(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, const char *aFirstSegment, PRUint32 aLength, nsACString & _retval)
  112. {
  113.     return NS_ERROR_NOT_IMPLEMENTED;
  114. }
  115.  
  116. /* void onStreamComplete (in nsIUnicharStreamLoader aLoader, in nsISupports aContext, in nsresult aStatus, in nsIUnicharInputStream aUnicharData); */
  117. NS_IMETHODIMP nsUnicharStreamLoaderObserver::OnStreamComplete(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, nsresult aStatus, nsIUnicharInputStream *aUnicharData)
  118. {
  119.     return NS_ERROR_NOT_IMPLEMENTED;
  120. }
  121.  
  122. /* End of implementation class template. */
  123. #endif
  124.  
  125.  
  126. /* starting interface:    nsIUnicharStreamLoader */
  127. #define NS_IUNICHARSTREAMLOADER_IID_STR "8a3eca16-167e-443d-9485-7e84ed822e95"
  128.  
  129. #define NS_IUNICHARSTREAMLOADER_IID \
  130.   {0x8a3eca16, 0x167e, 0x443d, \
  131.     { 0x94, 0x85, 0x7e, 0x84, 0xed, 0x82, 0x2e, 0x95 }}
  132.  
  133. class NS_NO_VTABLE nsIUnicharStreamLoader : public nsISupports {
  134.  public: 
  135.  
  136.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUNICHARSTREAMLOADER_IID)
  137.  
  138.   enum { DEFAULT_SEGMENT_SIZE = 4096U };
  139.  
  140.   /**
  141.    * Initializes the unichar stream loader
  142.    *
  143.    * @param aChannel the channel to read data from.  This should _not_ be
  144.    *        opened; the loader will open the channel itself.
  145.    * @param aObserver the observer to notify when a charset is needed and when
  146.    *        the load is complete
  147.    * @param aContext an opaque context pointer
  148.    * @param aSegmentSize the size of the segments to use for the data, in bytes
  149.    */
  150.   /* void init (in nsIChannel aChannel, in nsIUnicharStreamLoaderObserver aObserver, in nsISupports aContext, in unsigned long aSegmentSize); */
  151.   NS_IMETHOD Init(nsIChannel *aChannel, nsIUnicharStreamLoaderObserver *aObserver, nsISupports *aContext, PRUint32 aSegmentSize) = 0;
  152.  
  153.   /**
  154.    * The channel attribute is only valid inside the onDetermineCharset
  155.    * and onStreamComplete callbacks.  Otherwise it will be null.
  156.    */
  157.   /* readonly attribute nsIChannel channel; */
  158.   NS_IMETHOD GetChannel(nsIChannel * *aChannel) = 0;
  159.  
  160.   /**
  161.    * The charset that onDetermineCharset returned, if that's been
  162.    * called.
  163.    */
  164.   /* readonly attribute ACString charset; */
  165.   NS_IMETHOD GetCharset(nsACString & aCharset) = 0;
  166.  
  167. };
  168.  
  169. /* Use this macro when declaring classes that implement this interface. */
  170. #define NS_DECL_NSIUNICHARSTREAMLOADER \
  171.   NS_IMETHOD Init(nsIChannel *aChannel, nsIUnicharStreamLoaderObserver *aObserver, nsISupports *aContext, PRUint32 aSegmentSize); \
  172.   NS_IMETHOD GetChannel(nsIChannel * *aChannel); \
  173.   NS_IMETHOD GetCharset(nsACString & aCharset); 
  174.  
  175. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  176. #define NS_FORWARD_NSIUNICHARSTREAMLOADER(_to) \
  177.   NS_IMETHOD Init(nsIChannel *aChannel, nsIUnicharStreamLoaderObserver *aObserver, nsISupports *aContext, PRUint32 aSegmentSize) { return _to Init(aChannel, aObserver, aContext, aSegmentSize); } \
  178.   NS_IMETHOD GetChannel(nsIChannel * *aChannel) { return _to GetChannel(aChannel); } \
  179.   NS_IMETHOD GetCharset(nsACString & aCharset) { return _to GetCharset(aCharset); } 
  180.  
  181. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  182. #define NS_FORWARD_SAFE_NSIUNICHARSTREAMLOADER(_to) \
  183.   NS_IMETHOD Init(nsIChannel *aChannel, nsIUnicharStreamLoaderObserver *aObserver, nsISupports *aContext, PRUint32 aSegmentSize) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aChannel, aObserver, aContext, aSegmentSize); } \
  184.   NS_IMETHOD GetChannel(nsIChannel * *aChannel) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChannel(aChannel); } \
  185.   NS_IMETHOD GetCharset(nsACString & aCharset) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCharset(aCharset); } 
  186.  
  187. #if 0
  188. /* Use the code below as a template for the implementation class for this interface. */
  189.  
  190. /* Header file */
  191. class nsUnicharStreamLoader : public nsIUnicharStreamLoader
  192. {
  193. public:
  194.   NS_DECL_ISUPPORTS
  195.   NS_DECL_NSIUNICHARSTREAMLOADER
  196.  
  197.   nsUnicharStreamLoader();
  198.  
  199. private:
  200.   ~nsUnicharStreamLoader();
  201.  
  202. protected:
  203.   /* additional members */
  204. };
  205.  
  206. /* Implementation file */
  207. NS_IMPL_ISUPPORTS1(nsUnicharStreamLoader, nsIUnicharStreamLoader)
  208.  
  209. nsUnicharStreamLoader::nsUnicharStreamLoader()
  210. {
  211.   /* member initializers and constructor code */
  212. }
  213.  
  214. nsUnicharStreamLoader::~nsUnicharStreamLoader()
  215. {
  216.   /* destructor code */
  217. }
  218.  
  219. /* void init (in nsIChannel aChannel, in nsIUnicharStreamLoaderObserver aObserver, in nsISupports aContext, in unsigned long aSegmentSize); */
  220. NS_IMETHODIMP nsUnicharStreamLoader::Init(nsIChannel *aChannel, nsIUnicharStreamLoaderObserver *aObserver, nsISupports *aContext, PRUint32 aSegmentSize)
  221. {
  222.     return NS_ERROR_NOT_IMPLEMENTED;
  223. }
  224.  
  225. /* readonly attribute nsIChannel channel; */
  226. NS_IMETHODIMP nsUnicharStreamLoader::GetChannel(nsIChannel * *aChannel)
  227. {
  228.     return NS_ERROR_NOT_IMPLEMENTED;
  229. }
  230.  
  231. /* readonly attribute ACString charset; */
  232. NS_IMETHODIMP nsUnicharStreamLoader::GetCharset(nsACString & aCharset)
  233. {
  234.     return NS_ERROR_NOT_IMPLEMENTED;
  235. }
  236.  
  237. /* End of implementation class template. */
  238. #endif
  239.  
  240.  
  241. #endif /* __gen_nsIUnicharStreamLoader_h__ */
  242.